from apscheduler.schedulers.blocking import BlockingScheduler
from datetime import datetime
import os

def tick():
    print('Tick! The Time is: %s' % datetime.now())

if __name__ == '__main__':
    scheduler = BlockingScheduler()
    scheduler.add_job(tick,'interval',seconds=3)

    try:
        scheduler.start()
    except  (KeyboardInterrupt, SystemExit):
        pass